package com.demo2do.fms.scheduler.entity.appointment;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;

import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.jdbc.core.RowMapper;

import com.demo2do.core.persistence.support.QueryBuilder;
import com.demo2do.core.persistence.support.QueryFilter;
import com.demo2do.core.persistence.support.QueryOrder;
import com.demo2do.fms.scheduler.util.FormatUtils;

/**
 *
 * @author Ark
 *
 */
public class TransportRevenueScheduleSearch implements QueryBuilder {
    
    /** 选择的公司 */
    private Long organizationId;

    /** 
     * 业内业务标志
     * 
     *      - true  业内
     *      - false 业外
     */
    private Boolean business;
    
    /** 起始装卸地 - 来自父Finance */
    private Long srcWhId;
    
    /** 目的装卸地 - 来自父Finance */
    private Long destWhId;
    
    /** 委托客户 - 来自父Finance */
    private Long consignorId;
    
    /** 最终客户 - 来自Shipment */
    private Long customerId;
    
    /** 制造商 - 来自Shipment */
    private Long vhModelId;
    
    /** 外借公司 - 来自子Finance */
    private Long companyId;
    
    /** 结算标志 - 来自父Finance */
    private String collectStatus;
    
    /** 内部车队 - 来自Shipment-transMeansId */
    private String team;
    
    /** 是否开票 - 来自父Finance */
    private Boolean invoice;
    
    /** 是否销单 - 来自父Finance */
    private Boolean balanced;
    
    /** 调度指令日期 - 开始日期 - 来自Shipment */
    private String beginShipmentDate;
    
    /** 调度指令日期 - 结束日期 - 来自Shipment */
    private String endShipmentDate;
    
    /** 回单日期 - 开始日期 - 来自Shipment */
    private String beginAccConfirmDate;
    
    /** 回单日期 - 结束日期 - 来自Shipment */
    private String endAccConfirmDate;
    
    /** 开票日期 - 开始日期 - 来自父Finance */
    private String beginInvoiceDate;
    
    /** 开票日期 - 结束日期 - 来自父Finance */
    private String endInvoiceDate;
    
    /** 调度指令号列表 */
    private String loadNumbers;
    
    /** 订单号列表 */
    private String orderCodes;
    
    /** 起始行 */
    private Integer beginIndex;
    
    /** 截止行 */
    private Integer endIndex;
    
    private QueryFilter queryFilter;
    
    private QueryOrder queryOrder;
    
    /**
     * The default constructor
     */
    public TransportRevenueScheduleSearch() {
    }
    
    /**
     * construct by appointment
     * 
     * @param appointment
     */
    public TransportRevenueScheduleSearch(TransportRevenueAppointment appointment) {
        this.organizationId = appointment.getOrganizationId();
        this.beginShipmentDate = appointment.getBeginShipmentDate();
        this.endShipmentDate = appointment.getEndShipmentDate();
        this.collectStatus = appointment.getCollectStatus();
        if (appointment.getBusiness() != null) {
            this.business = appointment.getBusiness().intValue() == 1 ? true : false;
        }
        if (appointment.getInvoice() != null) {
            this.invoice = appointment.getInvoice().intValue() == 1 ? true : false;
        }
        if (appointment.getBalanced() != null) {
            this.balanced = appointment.getBalanced().intValue() == 1 ? true : false;
        }
    }
    
    /* (non-Javadoc)
     * @see com.demo2do.core.persistence.support.QueryBuilder#getPreparedFilter(boolean)
     */
    public QueryFilter getPreparedFilter(boolean refresh) {
        
        if (queryFilter == null || refresh) {
            
            queryFilter = new QueryFilter().addEquals("trans", "id", organizationId)
                                           .addEquals("f", "company_id", organizationId);
            
            if (StringUtils.isNotBlank(beginShipmentDate)) {
                queryFilter.addSentence("s.shipment_date >= TO_DATE('" + beginShipmentDate.replace("-", "") + "', 'yyyymmdd')", Collections.emptyMap());
            }
            
            if (StringUtils.isNotBlank(endShipmentDate)) {
                queryFilter.addSentence("s.shipment_date < TO_DATE('" + endShipmentDate.replace("-", "") + "', 'yyyymmdd') + TO_DSINTERVAL ('001 00:00:00')", Collections.emptyMap());
            }
            
            if (StringUtils.isNotBlank(beginAccConfirmDate)) {
                queryFilter.addSentence("s.acc_confirm_date >= TO_DATE('" + beginAccConfirmDate.replace("-", "") + "', 'yyyymmdd')", Collections.emptyMap());
            }
            
            if (StringUtils.isNotBlank(endAccConfirmDate)) {
                queryFilter.addSentence("s.acc_confirm_date < TO_DATE('" + endAccConfirmDate.replace("-", "") + "', 'yyyymmdd') + TO_DSINTERVAL ('001 00:00:00')", Collections.emptyMap());
            }
            
            if (StringUtils.isNotBlank(beginInvoiceDate)) {
                queryFilter.addSentence("f.sap_invoice_date >= TO_DATE('" + beginInvoiceDate.replace("-", "") + "', 'yyyymmdd')", Collections.emptyMap());
            }
            
            if (StringUtils.isNotBlank(endInvoiceDate)) {
                queryFilter.addSentence("f.sap_invoice_date < TO_DATE('" + endInvoiceDate.replace("-", "") + "', 'yyyymmdd') + TO_DSINTERVAL ('001 00:00:00')", Collections.emptyMap());
            }
            
            if (StringUtils.isNotBlank(loadNumbers)) {
                List<String> loadNumberList = this.constructList(loadNumbers);
                if (CollectionUtils.isNotEmpty(loadNumberList)) {
                    queryFilter.addSentence("s.load_number IN (:loadNumberList)", "loadNumberList", loadNumberList);
                }
            }
            
            if (StringUtils.isNotBlank(orderCodes)) {
                List<String> orderCodeList = this.constructList(orderCodes);
                if (CollectionUtils.isNotEmpty(orderCodeList)) {
                    queryFilter.addSentence("vo.code IN (:orderCodeList)", "orderCodeList", orderCodeList);
                }
            }
            
            queryFilter.addEquals("f", "is_balanced", balanced)
                       .addEquals("f", "is_sap_invoice", invoice)
                       .addEquals("f", "collect_status", collectStatus)
                       .addEquals("wa", "id", srcWhId)
                       .addEquals("wb", "id", destWhId)
                       .addEquals("f", "consignor_id", consignorId)
                       .addEquals("client", "id", customerId)
                       .addEquals("car", "manufactor_id", vhModelId)
                       .addEquals("f2", "company_id", companyId);
            
        }
        
        return queryFilter;
        
    }
    
    /**
     * @return
     */
    public String buildCountTemplate() {
        
        String sentence = null;
        
        if (business) {             // 业内
            
            sentence = "SELECT COUNT(*) FROM tbl_all_finance f, (select * from tbl_all_finance where is_disabled = 0) f2, tbl_all_shipment s, vw_consignor con, vw_transportation_company trans, vw_order vo, vw_client client, vw_warehouse wa, vw_warehouse wb, vw_car_category car, vw_car_color color, vw_vehicle vhc "
                     + "WHERE f.is_disabled = 0 AND s.is_disabled = 0 AND con.ID = f.consignor_id AND vo.id = s.ORDER_ID AND client.ID = s.customer_id AND wa.ID = f.src_wh_id AND wb.ID = f.dest_wh_id AND car.ID = s.vh_cartype_id AND color.ID = s.vh_color_id AND vhc.id = s.TRANS_MEANS_ID AND s.shipment_id = f.shipment_id AND s.load_number = f.load_number AND f.shipment_finance_id = f2.parent_id(+)"
                     + getPreparedFilter(false).clauseSentence();
            
        } else {                    // 业外
            
            sentence = "SELECT COUNT(*) FROM tbl_all_finance f, (select * from tbl_all_finance where is_disabled = 0) f2, tbl_all_shipment s, vw_transportation_company trans, vw_order vo, vw_client client, vw_warehouse wa, vw_warehouse wb, VW_CAR_CATEGORY car, vw_car_color color, vw_vehicle vhc "
                     + "WHERE f.is_disabled = 0 AND s.is_disabled = 0 AND f.consignor_id IS NULL AND vo.id = s.ORDER_ID AND client.ID = s.customer_id AND wa.ID = f.src_wh_id AND wb.ID = f.dest_wh_id AND car.ID = s.vh_cartype_id AND color.ID = s.vh_color_id AND vhc.id = s.TRANS_MEANS_ID AND s.shipment_id = f.shipment_id AND f.load_number IS NULL AND f.shipment_finance_id = f2.PARENT_ID(+)"
                     + getPreparedFilter(false).clauseSentence();
            
        }
        
        return sentence;
        
    }
    
    /* (non-Javadoc)
     * @see com.demo2do.core.persistence.support.QueryBuilder#buildSentenceTemplate()
     */
    public String buildSentenceTemplate() {
        
        StringBuffer buffer = new StringBuffer(256);
        
        if (business) {         // 业内
            
            buffer.append("SELECT vhc.VEHICLE_CODE || ' - ' || vhc.VEHICLE_NAME AS vehicle, ")
                  .append("s.load_number AS shipmentLoadNumber, ")
                  .append("FC_GET_DISPATCH_ORDER_CODE(s.DISPATCH_ORDER_ID) AS dispatchOrderCode, ")
                  .append("vo.code AS orderCode, ")
                  .append("FC_GET_SHIPMENT_METHOD(s.TRANS_TYPE) AS transType, ")
                  .append("con.organization_name AS consignorName, ")
                  .append("trans.organization_name AS transName, ")
                  .append("client.organization_code || ' - ' || client.organization_name AS client, ")
                  .append("FC_GET_MANUFACTOR_NAME(s.VH_CARTYPE_ID) AS manufactorName, ")
                  .append("wa.facility_code || ' - ' || wa.facility_name AS srcFacility, ")
                  .append("wb.facility_code || ' - ' || wb.facility_name AS destFacility, ")
                  .append("s.acc_confirm_date AS accConfirmDate, ")
                  .append("f.fee AS parentFee, ")
                  .append("f.fee_rate AS parentFeeRate, ")
                  .append("f.kilometer AS parentKilometer, ")
                  .append("f.sap_invoice_date AS sapInvoiceDate, ")
                  .append("f2.is_balanced AS balanced, ")
                  .append("car.product_category_name AS carName, ")
                  .append("color.feature_name AS colorName, ")
                  .append("FC_GET_VINCODE_BY_SHIPMENT_ID(s.shipment_id) AS vincode, ")
                  .append("f.is_temporary AS parentTemporary, ")
                  .append("NVL(FC_GET_TRUCK_TEAM(s.trans_means_id), FC_GET_ORG_NAME(f2.company_id)) AS childTransName, ")
                  .append("f.is_sap_invoice AS sapInvoice, ")
                  .append("(CASE f.COLLECT_STATUS WHEN 'N' THEN '不可结算' WHEN 'Y' THEN '可结算' WHEN 'C' THEN '已结算' WHEN 'S' THEN '已送SAP' END) AS collectStatus, ")
                  .append("f2.fee AS childFee, ")
                  .append("f2.fee_rate AS childFeeRate, ")
                  .append("f2.kilometer AS childKilometer, ")
                  .append("f2.is_temporary AS childTemporary, ")
                  .append("S.LEAVING_TIME AS leavingTime, ")
                  .append("s.order_id AS orderId, ")
                  .append("'FMS' || trans.organization_code AS organizationCode, ")
                  .append("f.session_id AS sessionId, ")
                  .append("f.first_shipment_id AS ayvin, ")
                  .append("S.SHIPMENT_DATE AS shipmentDate ")
            .append("FROM tbl_all_finance f, (select * from tbl_all_finance where is_disabled = 0) f2, tbl_all_shipment s, vw_consignor con, vw_transportation_company trans, vw_order vo, vw_client client, vw_warehouse wa, vw_warehouse wb, vw_car_category car, vw_car_color color, vw_vehicle vhc ")
            .append("WHERE f.is_disabled = 0 AND s.is_disabled = 0 AND con.ID = f.consignor_id AND vo.id = s.ORDER_ID AND client.ID = s.customer_id AND wa.ID = f.src_wh_id AND wb.ID = f.dest_wh_id AND car.ID = s.vh_cartype_id AND color.ID = s.vh_color_id AND vhc.id = s.TRANS_MEANS_ID AND s.shipment_id = f.shipment_id AND s.load_number = f.load_number AND f.shipment_finance_id = f2.parent_id(+)")
            .append(getPreparedFilter(false).clauseSentence());
            
        } else {                // 业外
            
            buffer.append("SELECT vhc.VEHICLE_CODE || ' - ' || vhc.VEHICLE_NAME AS vehicle, ")
                  .append("s.load_number AS shipmentLoadNumber, ")
                  .append("FC_GET_DISPATCH_ORDER_CODE(s.DISPATCH_ORDER_ID) AS dispatchOrderCode, ")
                  .append("vo.code AS orderCode, ")
                  .append("FC_GET_SHIPMENT_METHOD(s.TRANS_TYPE) AS transType, ")
                  .append("'' AS consignorName, ")
                  .append("trans.organization_name AS transName, ")
                  .append("client.organization_code || ' - ' || client.organization_name AS client, ")
                  .append("FC_GET_MANUFACTOR_NAME(s.VH_CARTYPE_ID) AS manufactorName, ")
                  .append("wa.facility_code || ' - ' || wa.facility_name AS srcFacility, ")
                  .append("wb.facility_code || ' - ' || wb.facility_name AS destFacility, ")
                  .append("s.acc_confirm_date AS accConfirmDate, ")
                  .append("f.fee AS parentFee, ")
                  .append("f.fee_rate AS parentFeeRate, ")
                  .append("f.kilometer AS parentKilometer, ")
                  .append("f.sap_invoice_date AS sapInvoiceDate, ")
                  .append("f2.is_balanced AS balanced, ")
                  .append("car.product_category_name AS carName, ")
                  .append("color.feature_name AS colorName, ")
                  .append("FC_GET_VINCODE_BY_SHIPMENT_ID(s.shipment_id) AS vincode, ")
                  .append("f.is_temporary AS parentTemporary, ")
                  .append("NVL(FC_GET_TRUCK_TEAM(s.trans_means_id), FC_GET_ORG_NAME(f2.company_id)) AS childTransName, ")
                  .append("f.is_sap_invoice AS sapInvoice, ")
                  .append("(CASE f.COLLECT_STATUS WHEN 'N' THEN '不可结算' WHEN 'Y' THEN '可结算' WHEN 'C' THEN '已结算' WHEN 'S' THEN '已送SAP' END) AS collectStatus, ")
                  .append("f2.fee AS childFee, ")
                  .append("f2.fee_rate AS childFeeRate, ")
                  .append("f2.kilometer AS childKilometer, ")
                  .append("f2.is_temporary AS childTemporary, ")
                  .append("S.LEAVING_TIME AS leavingTime, ")
                  .append("s.order_id AS orderId, ")
                  .append("'FMS' || trans.organization_code AS organizationCode, ")
                  .append("f.session_id AS sessionId, ")
                  .append("f.first_shipment_id AS ayvin, ")
                  .append("S.SHIPMENT_DATE AS shipmentDate ")
              .append("FROM tbl_all_finance f, (select * from tbl_all_finance where is_disabled = 0) f2, tbl_all_shipment s, vw_transportation_company trans, vw_order vo, vw_client client, vw_warehouse wa, vw_warehouse wb, VW_CAR_CATEGORY car, vw_car_color color, vw_vehicle vhc ")
              .append("WHERE f.is_disabled = 0 AND s.is_disabled = 0 AND f.consignor_id IS NULL AND vo.id = s.ORDER_ID AND client.ID = s.customer_id AND wa.ID = f.src_wh_id AND wb.ID = f.dest_wh_id AND car.ID = s.vh_cartype_id AND color.ID = s.vh_color_id AND vhc.id = s.TRANS_MEANS_ID AND s.shipment_id = f.shipment_id AND f.load_number IS NULL AND f.shipment_finance_id = f2.PARENT_ID(+)")
              .append(getPreparedFilter(false).clauseSentence());
            
        }
        
        String sentence = "SELECT page.*, ROWNUM rn FROM (" + buffer.toString() + ") page WHERE ROWNUM <= " + endIndex;
        sentence = "SELECT * FROM (" + sentence + ") WHERE rn >= " + beginIndex;
        
        return sentence;
        
    }
    
    /**
     * build rowMapper
     * 
     * @return
     */
    public RowMapper<String[]> buildRowMapper() {
        
        RowMapper<String[]> rowMapper = new RowMapper<String[]>() {
            
            /* (non-Javadoc)
             * @see org.springframework.jdbc.core.RowMapper#mapRow(java.sql.ResultSet, int)
             */
            public String[] mapRow(ResultSet rs, int rowNum) throws SQLException {
                
                String vehicle = rs.getString("vehicle");
                String orderCode = rs.getString("orderCode");
                String shipmentLoadNumber = rs.getString("shipmentLoadNumber");
                String dispatchOrderCode = rs.getString("dispatchOrderCode");
                String leavingTime = FormatUtils.formatDateTime(rs.getDate("leavingTime"));
                String shipmentDate = FormatUtils.formatDateTime(rs.getDate("shipmentDate"));
                String transType = rs.getString("transType");
                String consignorName = rs.getString("consignorName");
                String transName = rs.getString("transName");
                String client = rs.getString("client");
                String manufactorName = rs.getString("manufactorName");
                String srcFacility = rs.getString("srcFacility");
                String destFacility = rs.getString("destFacility");
                String accConfirmDate = FormatUtils.formatDate(rs.getDate("accConfirmDate"));
                String collectStatus = rs.getString("collectStatus");
                String parentFee = FormatUtils.formatNumber(rs.getBigDecimal("parentFee"));
                String parentFeeRate = FormatUtils.formatNumber(rs.getBigDecimal("parentFeeRate"));
                String parentKilometer = FormatUtils.formatNumber(rs.getBigDecimal("parentKilometer"));
                String parentTemporary = rs.getBoolean("parentTemporary") ? "是" : "否";
                String sapInvoice = rs.getBoolean("sapInvoice") ? "是" : "否";
                String sapInvoiceDate = FormatUtils.formatDate(rs.getDate("sapInvoiceDate"));
                String balanced = rs.getBoolean("balanced") ? "是" : "否";
                String carName = rs.getString("carName");
                String colorName = rs.getString("colorName");
                String vincode = rs.getString("vincode");
                String childTransName = rs.getString("childTransName");
                String childFee = FormatUtils.formatNumber(rs.getBigDecimal("childFee"));
                String childFeeRate = FormatUtils.formatNumber(rs.getBigDecimal("childFeeRate"));
                String childKilometer = FormatUtils.formatNumber(rs.getBigDecimal("childKilometer"));
                String childTemporary = rs.getBoolean("childTemporary") ? "是" : "否";
                String organizationCode = rs.getString("organizationCode");
                String orderId = rs.getString("orderId");
                String ayvin = rs.getString("ayvin");
                String sessionId = rs.getString("sessionId");
                
                String[] result = {vehicle, orderCode, shipmentLoadNumber, dispatchOrderCode, leavingTime, shipmentDate, transType, consignorName, transName, client,
                        manufactorName, srcFacility, destFacility, accConfirmDate, collectStatus, parentFee, parentFeeRate, parentKilometer, parentTemporary, sapInvoice, sapInvoiceDate,
                        balanced, carName, colorName, vincode, childTransName, childFee, childFeeRate, childKilometer, childTemporary, organizationCode, orderId, ayvin, shipmentLoadNumber,
                        childFee, parentFee, sessionId};
                return result;
                
            }
            
        };
        
        return rowMapper;
        
    }
    
    /* (non-Javadoc)
     * @see com.demo2do.core.persistence.support.QueryBuilder#buildParameters()
     */
    public Map<String, Object> buildParameters() {
        return getPreparedFilter(false).parameters();
    }
    
    /* (non-Javadoc)
     * @see com.demo2do.core.persistence.support.QueryBuilder#getOrder()
     */
    public QueryOrder getOrder() {
        return queryOrder;
    }
    
    /**
     * @param code
     * @return
     */
    private List<String> constructList(String code) {
        code = StringUtils.replaceAll(code, "\r", "");
        code = StringUtils.replaceAll(code, "\t", "");
        code = StringUtils.replaceAll(code, " ", "");
        String[] temp = StringUtils.split(code, "\n");
        return Arrays.asList(temp);
    }
    
    /**
     * @return
     */
    public Long getOrganizationId() {
        return organizationId;
    }

    /**
     * @return the business
     */
    public Boolean getBusiness() {
        return business;
    }

    /**
     * @return the srcWhId
     */
    public Long getSrcWhId() {
        return srcWhId;
    }

    /**
     * @return the destWhId
     */
    public Long getDestWhId() {
        return destWhId;
    }

    /**
     * @return the consignorId
     */
    public Long getConsignorId() {
        return consignorId;
    }

    /**
     * @return the customerId
     */
    public Long getCustomerId() {
        return customerId;
    }

    /**
     * @return the vhModelId
     */
    public Long getVhModelId() {
        return vhModelId;
    }

    /**
     * @return the companyId
     */
    public Long getCompanyId() {
        return companyId;
    }

    /**
     * @return the collectStatus
     */
    public String getCollectStatus() {
        return collectStatus;
    }

    /**
     * @return
     */
    public String getTeam() {
        return team;
    }

    /**
     * @return the invoice
     */
    public Boolean getInvoice() {
        return invoice;
    }

    /**
     * @return the balanced
     */
    public Boolean getBalanced() {
        return balanced;
    }

    /**
     * @return the beginShipmentDate
     */
    public String getBeginShipmentDate() {
        return beginShipmentDate;
    }

    /**
     * @return the endShipmentDate
     */
    public String getEndShipmentDate() {
        return endShipmentDate;
    }

    /**
     * @return the beginAccConfirmDate
     */
    public String getBeginAccConfirmDate() {
        return beginAccConfirmDate;
    }

    /**
     * @return the endAccConfirmDate
     */
    public String getEndAccConfirmDate() {
        return endAccConfirmDate;
    }

    /**
     * @return the beginInvoiceDate
     */
    public String getBeginInvoiceDate() {
        return beginInvoiceDate;
    }

    /**
     * @return the endInvoiceDate
     */
    public String getEndInvoiceDate() {
        return endInvoiceDate;
    }

    /**
     * @return
     */
    public String getLoadNumbers() {
        return loadNumbers;
    }
    
    /**
     * @return
     */
    public String getOrderCodes() {
        return orderCodes;
    }
    
    /**
     * @return
     */
    public Integer getEndIndex() {
        return endIndex;
    }
    
    /**
     * @param organizationId
     */
    public void setOrganizationId(Long organizationId) {
        this.organizationId = organizationId;
    }

    /**
     * @param business the business to set
     */
    public void setBusiness(Boolean business) {
        this.business = business;
    }

    /**
     * @param srcWhId the srcWhId to set
     */
    public void setSrcWhId(Long srcWhId) {
        this.srcWhId = srcWhId;
    }

    /**
     * @param destWhId the destWhId to set
     */
    public void setDestWhId(Long destWhId) {
        this.destWhId = destWhId;
    }

    /**
     * @param consignorId the consignorId to set
     */
    public void setConsignorId(Long consignorId) {
        this.consignorId = consignorId;
    }

    /**
     * @param customerId the customerId to set
     */
    public void setCustomerId(Long customerId) {
        this.customerId = customerId;
    }

    /**
     * @param vhModelId the vhModelId to set
     */
    public void setVhModelId(Long vhModelId) {
        this.vhModelId = vhModelId;
    }

    /**
     * @param companyId the companyId to set
     */
    public void setCompanyId(Long companyId) {
        this.companyId = companyId;
    }

    /**
     * @param collectStatus the collectStatus to set
     */
    public void setCollectStatus(String collectStatus) {
        this.collectStatus = collectStatus;
    }

    /**
     * @param team
     */
    public void setTeam(String team) {
        this.team = team;
    }

    /**
     * @param invoice the invoice to set
     */
    public void setInvoice(Boolean invoice) {
        this.invoice = invoice;
    }

    /**
     * @param balanced the balanced to set
     */
    public void setBalanced(Boolean balanced) {
        this.balanced = balanced;
    }

    /**
     * @param beginShipmentDate the beginShipmentDate to set
     */
    public void setBeginShipmentDate(String beginShipmentDate) {
        this.beginShipmentDate = beginShipmentDate;
    }

    /**
     * @param endShipmentDate the endShipmentDate to set
     */
    public void setEndShipmentDate(String endShipmentDate) {
        this.endShipmentDate = endShipmentDate;
    }

    /**
     * @param beginAccConfirmDate the beginAccConfirmDate to set
     */
    public void setBeginAccConfirmDate(String beginAccConfirmDate) {
        this.beginAccConfirmDate = beginAccConfirmDate;
    }

    /**
     * @param endAccConfirmDate the endAccConfirmDate to set
     */
    public void setEndAccConfirmDate(String endAccConfirmDate) {
        this.endAccConfirmDate = endAccConfirmDate;
    }

    /**
     * @param beginInvoiceDate the beginInvoiceDate to set
     */
    public void setBeginInvoiceDate(String beginInvoiceDate) {
        this.beginInvoiceDate = beginInvoiceDate;
    }

    /**
     * @param endInvoiceDate the endInvoiceDate to set
     */
    public void setEndInvoiceDate(String endInvoiceDate) {
        this.endInvoiceDate = endInvoiceDate;
    }

    /**
     * @param loadNumbers
     */
    public void setLoadNumbers(String loadNumbers) {
        this.loadNumbers = loadNumbers;
    }

    /**
     * @param orderCodes
     */
    public void setOrderCodes(String orderCodes) {
        this.orderCodes = orderCodes;
    }
    
    /**
     * @param beginIndex
     */
    public void setBeginIndex(Integer beginIndex) {
        this.beginIndex = beginIndex;
    }
    
    /**
     * @param endIndex
     */
    public void setEndIndex(Integer endIndex) {
        this.endIndex = endIndex;
    }
    
}
